package org.binglan.youziyuepai.mapper;

        import com.baomidou.mybatisplus.core.metadata.IPage;
        import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
        import org.apache.ibatis.annotations.Param;
        import org.apache.ibatis.annotations.Select;
        import org.binglan.youziyuepai.entity.Activity;
        import com.baomidou.mybatisplus.core.mapper.BaseMapper;

        import java.util.List;

/**
 * <p>
 * 活动表 Mapper 接口
 * </p>
 *
 * @author sanjin
 * @since 2019-04-09
 */
public interface ActivityMapper extends BaseMapper<Activity> {

    /**
     * 通过活动id获取活动的参加用户
     */
    @Select("SELECT au.user_id FROM activity_to_user au WHERE au.activity_id = #{activityId}")
    List<String> queryUserIdsByActivityId(Integer activityId);

    IPage<Activity> queryActivityByPage(Page<Activity> page,@Param("isAllow") Integer isAllow);
}
